package vn.bus.service;

import java.util.ArrayList;

import com.google.gson.Gson;

import vn.bus.models.TimetableManager;
import vn.bus.dto.TimetableDTO;

public class TimetableService {

	public String getAllTimetables() {
		String rs = null;
		try {
			ArrayList<TimetableDTO> allTimetables = null;
			TimetableManager timetableManager = new TimetableManager();
			allTimetables = timetableManager.getAllTimetables();
			Gson gson = new Gson();
			/*System.out.println("TimetableService - method : getAllTimetables : "
					+ gson.toJson(allTimetables));*/
			rs = gson.toJson(allTimetables);

		} catch (Exception e) {
			System.out.println("error");
		}
		return rs;
	}
}
